# 定义一个1~10的list 穷举
# 定义一个1~100的list 勉强可以穷举

# 列表推导式：可以通过一个表达式来生成一个list
# 通常会结合range()方法一起使用
# range(起始值,结束值,步长) 左闭右开
for i in range(1, 11):
    print(i)

# 生成1~100的list
list1 = [i for i in range(1, 101)]
print(list1)

# 生成一个1~100只包含奇数的list
list2 = [i for i in range(1, 101) if i % 2 == 1]
print(list2)

# 9 9 乘法表
# i * j = i*j
# 1 * 1 = 1
# "{} * {} = {}"
# print("\n".join(["\t".join(["{} * {} = {}".format(i, j, i * j) for j in range(1, i + 1)]) for i in range(1, 10)]))
#
# list2 = [i for i in range(1, 10)]
# for i in list2:
#     # list3 = []
#     # for j in range(1, i + 1):
#     #     list3.append("{} * {} = {}".format(i, j, i * j))
#     # print("\t".join(list3))
#     list4 = ["{} * {} = {}".format(i, j, i * j) for j in range(1, i + 1)]
#     print("\t".join(list4))

print("\n".join(["\t".join(["{} * {} = {}".format(i, j, i * j) for j in range(1, i + 1)]) for i in range(1, 10)]))

list5 = ["a", "b", "c", "d"]
for index, i in enumerate(list5):
    """
    0 a
    1 b
    2 c
    3 d
    """
    print(index, i)

list6 = ["zhangsan", "lisi", "wangwu"]
score_list = [100, 90, 95]

for i,j in zip(list6, score_list):
    print(i,j)
